package com.service.impl;

import com.dao.UserDao;
import com.dao.impl.UserDaoImpl;
import com.entity.User;
import com.service.UserSerivce;

import java.util.List;

/**
 * @author wzm
 * @create 2023-03-07 10:39
 */
public class UserServiceImpl implements UserSerivce {
   private UserDao userDao = new UserDaoImpl();

    @Override
    public User login(User user) {
        //调用dao实现功能
        return userDao.selectByNameAndPwd(user);
    }

    @Override
    public boolean register(User user) {
        return userDao.insertUser(user) > 0;
    }

    @Override
    public List<User> selectByName(User user) {
        return userDao.selectByName(user);
    }
}
